﻿@model IEnumerable<ArunimaErp.Domain.productiondailyreport>

@{
    ViewBag.Title = "Index";
}

@using Telerik.Web.Mvc.UI

<script src="../../Scripts/Custom/dprDialog.js" type="text/javascript"></script>

<article class="module width_full">
<header><h3>ArunimaErp</h3></header>
<div class="module_content">
    
    <p>@Html.ActionLink("Create New", "Create","", new { @class="create"})</p>

    <div id="successmessage"></div>

@(Html.Telerik().Grid(Model)
    .Name("DprGrid")
        .DataKeys(datakeys => datakeys.Add(k => k.ProductionDailyReportId))
            .Columns(columns =>
            {
                columns.Template(c => Html.ActionLink("Edit", "Edit", new { id = c.ProductionDailyReportId }, new { @class = "edit" }) + " | " + Html.ActionLink("Delete", "Delete", new { id = c.ProductionDailyReportId }, new { @class = "delete" }))
                    .Title("Action").Width(80);

                columns.Bound(c => c.postyle.styleinfo.buyerinfo.BuyerName).Width(80).Title("Buyer");
                columns.Bound(c => c.postyle.styleinfo.StyleNo).Width(110);
                columns.Bound(c => c.postyle.PoNo).Width(110);
                columns.Bound(c => c.Floor).Width(60);
                columns.Bound(c => c.Line).Width(60);
                columns.Bound(c => c.Hour).Width(60);
                columns.Bound(c => c.Date).Format("{0:dd-MMM-yy}").Width(75);
                columns.Bound(c => c.Cutting).Width(80)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.SewingInput).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.TodaySewing).Title("Sewing").Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.SentPrintEmb).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.ReceivedPrintEmb).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.SentWash).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.ReceivedWash).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
                columns.Bound(c => c.TodayFinish).Width(100)
                    .Aggregate(a => a.Sum())
                    .GroupFooterTemplate(result => "Total : " + result.Sum);
            })
    .ColumnContextMenu()
    .Groupable()
    .Filterable()
    .Pageable(x=>x.PageSize(20))
    .Sortable()
    .Scrollable(x=>x.Height(400))
    .Resizable(x=>x.Columns(true))
    .Reorderable(x=>x.Columns(true))
  )

<div id="dprDialogDiv" title="Daily Production Report"></div>

</div>
</article>

<div class="spacer"></div>